<?php
$cs=Yii::app()->getClientScript();
$cs->registerScriptFile(Yii::app()->params['jsDomain'].'/js/jquery.editinplace.js');

$savingImage=CJavaScript::quote(CHtml::normalizeUrl(Yii::app()->params['sysImageDomain'].'/images/ajax-loader.gif'));

$setTitleUrl=CJavaScript::quote(CHtml::normalizeUrl(array('setTitle','id'=>$recipe->id)));
$cs->registerScript('title', 
    "$('.title').editInPlace({
        url:'$setTitleUrl', 
        show_buttons:true,
        saving_image: '$savingImage'
    });"
);

$setDescriptionUrl=CJavaScript::quote(CHtml::normalizeUrl(array('setDescription','id'=>$recipe->id)));
$cs->registerScript('description', 
    "$('.description').editInPlace({
        url:'$setDescriptionUrl',
        field_type: 'textarea', 
        textarea_rows: '3',
        textarea_cols: '45',        
        show_buttons:true,
        saving_image: '$savingImage'
    });"
);

?>